import 'package:demo/theme/app_colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'package:get/get.dart';

import '../../../../theme/app_text_theme.dart';
import 'face_error_controller.dart';

class FaceErrorView extends GetView<FaceErrorController> {
  const FaceErrorView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Color_bg,
      appBar: AppBar(title: Text('人脸身份核验', style: text_title_black)),
      body: SizedBox(
        width: Get.width,
        child: Column(
          children: [
            SizedBox(height: 88.w),
            Obx(() => Image.asset('assets/images/${controller.noNet.value ? 'icon_verify_network' : 'ic_warning'}.png', width: 76.w, height: 76.w)),
            SizedBox(height: 30.w),
            Obx(() => Text(controller.msg.value, style: text_131732_16)),
            SizedBox(height: 12.w),
            Obx(() => Text(controller.tips.value, style: text_grey_12)),
            SizedBox(height: 30.w),
            Expanded(child: Container()),
            RawMaterialButton(
              fillColor: Color_main,
              elevation: 0,
              highlightElevation: 0,
              shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(22.w))),
              constraints: BoxConstraints.tightFor(width: Get.width - 60.w, height: 44.w),
              child: Obx(() => Text(controller.btn1.value, style: text_white_14b)),
              onPressed: () => Get.back(),
            ),
            Visibility(
              visible: controller.showBtn2.value,
              child: SizedBox(height: 15.w)),
            Obx(() => Visibility(
              visible: controller.showBtn2.value,
              child: RawMaterialButton(
                fillColor: Color_grey.withOpacity(0.3),
                elevation: 0,
                highlightElevation: 0,
                shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(22.w))),
                constraints: BoxConstraints.tightFor(width: Get.width - 60.w, height: 44.w),
                child: Text('退出核验', style: text_131732_14b),
                onPressed: () => Get.back(),
              ),
            )),
            SizedBox(height: 30.w),
          ],
        ),
      ),
    );
  }
}
